/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.testis.client;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author nurhat
 */
public class NewMain1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Pattern p = Pattern.compile("(\\w)\\1+");
        Matcher m = p.matcher("aaxbbb");
        System.out.println("Duplicate character " + m.groupCount());
        
        if (m.find()) {
            System.out.println("Duplicate character " + m.groupCount());
        }


        System.out.println( m.replaceAll("z"));
    }
}
